import { useState } from "react";
import "./index.scss";
interface IndexProps {
  imgs: string;
  name: string;
  px: string;
}

const Index: React.FC<IndexProps> = ({ imgs, name, px }) => {
  const [transday, setTransday] = useState("scale(1)");
  const handlesuo = () => {
    setTransday("scale(1.1)");
  };
  const handlefan = () => {
    setTransday("scale(1)");
  };
  return (
    <div className="creates" onMouseEnter={handlesuo} onMouseLeave={handlefan}>
      <div className="create_img">
        {imgs == "" ? (
          <div className="create_jia">+</div>
        ) : (
          <img style={{ transform: transday }} src={imgs} alt="" />
        )}
      </div>
      <div className="create_text">{name}</div>
      <div className="create_px">{px}</div>
    </div>
  );
};

export default Index;
